﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DynamicDNS.Model;
using DynamicDNS.Wpf.ConfigServiceReference;
using System.ComponentModel;

namespace DynamicDNS.Wpf
{
    public class ConfigServiceClient : INotifyPropertyChanged, IConfigurationService
    {
        private ConfigurationServiceClient Client = new ConfigurationServiceClient();
        private static readonly ConfigServiceClient instance;        
        public static ConfigServiceClient Instance { get { return instance; } }
        public event PropertyChangedEventHandler PropertyChanged;

        private ConfigServiceClient() { }
        static ConfigServiceClient()
        {
            instance = new ConfigServiceClient();
        }

        public StartType GetStartType()
        {
            return Client.GetStartType();
        }

        public async Task<StartType> GetStartTypeAsync()
        {
            return await Client.GetStartTypeAsync();
        }

        public StartType SetStartType(StartType starttype)
        {
            return Client.SetStartType(starttype);
        }

        public async Task<StartType> SetStartTypeAsync(StartType starttype)
        {
            return await Client.SetStartTypeAsync(starttype);
        }

        public Record[] GetRecords()
        {
            return Client.GetRecords();
        }

        public async Task<Record[]> GetRecordsAsync()
        {
            return await Client.GetRecordsAsync();
        }

        public Record[] SetRecord(Record record)
        {
            return Client.SetRecord(record);
        }

        public async Task<Record[]> SetRecordAsync(Record record)
        {
            return await Client.SetRecordAsync(record);
        }

        public Record[] DeleteRecord(Record record)
        {
            return Client.DeleteRecord(record);
        }

        public async Task<Record[]> DeleteRecordAsync(Record record)
        {
            return await Client.DeleteRecordAsync(record);
        }

        public Record[] UpdateRecord(Record record)
        {
            return Client.UpdateRecord(record);
        }

        public async Task<Record[]> UpdateRecordAsync(Record record)
        {
            return await Client.UpdateRecordAsync(record);
        }

        public Record[] UpdateAll(bool force)
        {
            return Client.UpdateAll(force);
        }

        public async Task<Record[]> UpdateAllAsync(bool force)
        {
            return await Client.UpdateAllAsync(force);
        }
    }
}
